package testUnit;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.After;
import org.junit.Before;

import FamilyTherapy.Board;
import FamilyTherapy.EventCard;

public class testBoard
{

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	@Test
	public void testBoard() 
	{
		boolean isNEW=false;
		Board b=new Board();
		
		if(b!=null)
			isNEW=true;
		assertEquals(true,isNEW);
		
	}
	//following 4 test cases are for testing the functionalities 
	@Test
	public void testGetBox_c0()
	{
		int result;
		Board board = new Board();
		result = board.getBox(0); // board [0]
		assertEquals(result, 0);	
	}

	@Test
	public void testGetBox_c1()
	{
		int result;
		Board board = new Board();
		result = board.getBox(4); // board [4]
		assertEquals(result, 1);	
	}
	
	@Test
	public void testGetBox_c2()
	{
		int result;
		Board board = new Board();
		result = board.getBox(2);
		assertEquals(result, 2);	
	}
	
	@Test
	public void testGetBox_c3()
	{
		int result;
		Board board = new Board();
		result = board.getBox(7);
		assertEquals(result, 3);	
	}
	
	//the following are for testing whether the function can handle bounding exceptions(-1 0 28 29)
	
	//-1 case occurs error of "ArrayIndexOutOfBoundException"
	/*public void testGetBox_cNegative1()
	{
		int result;
		Board board = new Board();
		result = board.getBox(-1);
		assertEquals(result, 0); 	
	}*/
	
	@Test
	public void testGetBox_c28()
	{
		int result;
		Board board = new Board();
		result = board.getBox(28);
		assertEquals(result, 0); 	
	}
	
	@Test
	public void testGetBox_c30()
	{
		int result;
		Board board = new Board();
		result = board.getBox(30);
		assertEquals(result, 2); 	
	}


}
